import request from "@/utils/request";

const urlPrefix = "/patient"

export function toPatient(patient) {
    return request({
        url: urlPrefix + "/addPatient",
        method: "post",
        data: {
            ...patient
        }
    })
}

export function getPatientList(page, pageSize,keyword) {
    return request({
        url: urlPrefix + "/list",
        method: "get",
        params: {
            page: page,
            size: pageSize,
            keyword: keyword
        }
    })
}

export function updatePatient(baseId, treatmentMsg) {
    return request({
        url: urlPrefix + "/updatePatient",
        method: 'post',
        params: {
            baseId: baseId,
            ...treatmentMsg
        }
    })
}

export function tuCure(baseId, cureMsg) {
    return request({
        url: urlPrefix + "/addCure",
        method: "post",
        params: {
            baseId: baseId,
            ...cureMsg
        }
    })
}

export function toDeath(baseId, deadTime) {
    return request({
        url: urlPrefix + "/addDead",
        method: "post",
        params: {
            baseId: baseId,
            deadTime: deadTime
        }
    })
}
